package com.zelix;

import java.util.Enumeration;
import java.util.HashSet;

public class e6 {

    private Object a[];
    private HashSet b;
    private int c;
    private int d;
    private int e;
    private static String z[];

    public e6() {
        this(10);
    }

    public e6(int i) {
        c = 0;
        d = 0;
        e = 0;
        if (i <= 1) {
            throw new IllegalArgumentException(z[1]);
        } else {
            a = new Object[i];
            b = new HashSet(px.a(i));
            return;
        }
    }

    public boolean a(Object obj) {
        if (!b.add(obj))
            return false;
        int i = a.length;
        if (e == i) {
            a();
            i = a.length;
        }
        a[d] = obj;
        d = (d + 1) % i;
        e++;
        return true;
    }

    public void a(Enumeration enumeration) {
        while (enumeration.hasMoreElements()) {
            a(enumeration.nextElement());
        }
    }

    private void a() {
        int i;
        Object aobj[];
        int j;
        i = a.length;
        aobj = new Object[i * 2];
        for (j = 0; j < e; j++) {
            int k = (c + j) % i;
            aobj[j] = a[k];
        }
        c = 0;
        d = e;
        a = aobj;
    }

    public boolean equals(Object obj) {
        e6 e6_1;
        int i;
        int j;
        int k;
        if (obj == this)
            return true;
        if ((obj instanceof e6)) {
            e6_1 = (e6) obj;
            if (e != e6_1.e)
                return false;
            i = a.length;
            j = e6_1.a.length;
            for (k = 0; k < e; k++) {
                int l = (c + k) % i;
                int i1 = (e6_1.c + k) % j;
                if (!a[l].equals(e6_1.a[i1]))
                    return false;
            }
            return true;
        }
        return false;
    }

    public int hashCode() {
        int i;
        int j;
        int k;
        i = 1;
        j = a.length;
        for (k = 0; k < e; k++) {
            int l = (c + k) % j;
            i = 31 * i + a[l].hashCode();
        }
        return i;
    }

    public boolean b() {
        return e == 0;
    }

    public Object c() {
        if (e == 0) {
            throw new z0(z[0]);
        } else {
            int i = a.length;
            Object obj = a[c];
            c = (c + 1) % i;
            e--;
            b.remove(obj);
            return obj;
        }
    }

    public int d() {
        return e;
    }

    private static String z(char[] chs) {
        byte key = 0;
        for (int i = 0; i < chs.length; i++) {
            switch (i % 5) {
                case 0:
                    key = 0x0c;
                    break;
                case 1:
                    key = 109;
                    break;
                case 2:
                    key = 64;
                    break;
                case 3:
                    key = 62;
                    break;
                case 4:
                    key = 124;
                    break;
            }
            chs[i] ^= key;
        }
        return new String(chs).intern();
    }

    static {
        String as[];
        as = new String[2];
        as[0] = z("I\0000J\005,<5[\ti".toCharArray());
        as[1] = z("]\030%K\031,\036)D\031,\0005M\b,\017%\036\033~\b!J\031~M4V\035bMq".toCharArray());
        z = as;
    }
}